<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<meta name="description" content="">
<meta name="author" content="">

<title>客户商品</title>

<!-- Bootstrap core CSS -->
<link href="<%=basePath%>css/bootstrap.min.css" rel="stylesheet">

<!-- Custom styles for this template -->
<link href="<%=basePath%>css/designer.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
      <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
    <script type="text/javascript" src="<%=basePath%>js/wz_tooltip.js"></script>
    <jsp:useBean id="planList" class="com.xlf.cache.PlanList" />
    <jsp:useBean id="orderStatusList" class="com.xlf.cache.OrderStatusList" />
    <jsp:useBean id="Tel" class="com.xlf.cache.Tel"/>
    <div class="container">
      <div class="form-horizontal">
        <div class="row">
          <div class="col-md-6">
            <fieldset>
              <div id="legend">
                <legend>客户信息</legend>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">订单编号</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" name="order.o_id" value="${order.o_id }" readonly="readonly">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">创建日期</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" value="<fmt:formatDate value="${order.createTime}" type="date"/>" readonly="readonly">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">客户姓名</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" value="${order.custerName }" readonly="readonly">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">客户电话</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" value="${order.custerTel }" readonly="readonly">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">客户地址</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" value="${order.custerAddress }" readonly="readonly">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">房屋面积</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" value="${order.roomSize }" readonly="readonly">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">购房合同照片</label>
                <div class="col-sm-8">
                  <c:if test="${not empty order.contractPic }">
                  <a class="btn btn-info" href="<%=basePath %>upload/contract/${order.contractPic }" target="_blank"><span class="glyphicon glyphicon-picture" aria-hidden="true"></span>点击查看</a>
                  </c:if>
                </div>
              </div>
            </fieldset>
          </div>
          <div class="col-md-6">
            <fieldset>
              <div id="legend">
                <legend>公司信息</legend>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">设计师姓名</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" name="order.designerName" value="${order.designerName }" readonly="readonly">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">设计师电话</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" name="order.designerTel" value="${order.designerTel }" readonly="readonly">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">主材部电话</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" value="${Tel.getMaterialTel() }" readonly="readonly">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">工程部电话</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" value="${Tel.getEngineTel() }" readonly="readonly">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">订单状态</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" value="${orderStatusList.getName(order.status) }" readonly="readonly">
                </div>
              </div>
            </fieldset>
          </div>
        </div>
      </div>
      <div class="row">
        <fieldset>
          <div id="legend">
            <legend>主材明细</legend>
          </div>
        </fieldset>
      </div>
      <c:forEach items="${orderCatalogs }" var="orderCatalog" varStatus="s">
        <c:if test="${orderCatalog.getOrderItems().size() > 0 }">
          <div class="row">
            <div class="panel panel-default">
              <div class="panel-heading"><strong>${orderCatalog.name }</strong></div>
              <div class="panel-body">
                <table class="table table-bordered table-striped">
                  <thead>
                    <tr>
                      <c:if test="${orderCatalog.c_id == 9 }">
                        <th>名称</th>
                      </c:if>
                      <c:if test="${orderCatalog.c_id != 9 }">
                        <th>图片</th>
                        <th>品牌</th>
                        <th>型号</th>
                        <th>规格</th>
                        <th>材质</th>
                      </c:if>
                      <th>单位</th>
                      <c:if test="${order.planType == 4 }">
                        <th>价格</th>
                      </c:if>
                      <th>数量</th>
                      <th>使用位置</th>
                      <th>备注</th>
                      <c:if test="${orderCatalog.c_id != 9 }">
                        <th>量尺时间</th>
                        <th>送货时间</th>
                      </c:if>
                    </tr>
                  </thead>
                  <tbody>
                    <c:forEach items="${orderCatalog.getOrderItems() }" var="orderItem" varStatus="s">
                      <tr>
                        <c:if test="${orderCatalog.c_id == 9 }">
                          <td>${orderItem.get('brand') }</td>
                        </c:if>
                        <c:if test="${orderCatalog.c_id != 9 }">
                          <td>
                          <a href="#" onmouseover="TagToTip('span${orderItem.get('p_id') }');" onmouseout="UnTip();"><img src="<%=basePath %>upload/${orderItem.get('pic') }" border="0" class="product_img"/></a>
                          <span id="span${orderItem.get('p_id') }">
                            <img src="<%=basePath %>upload/${orderItem.get('pic') }" width="196px" height="196px">
                          </span>
                          </td>
                          <td>${orderItem.get('brand') }</td>
                          <td>${orderItem.get('type') }</td>
                          <td>${orderItem.get('spec') }</td>
                          <td>${orderItem.get('material') }</td>
                        </c:if>
                        <td>${orderItem.get('unit') }</td>
                        <c:if test="${order.planType == 4 }">
                          <td>${orderItem.get('price') }</td>
                        </c:if>
                        <td>${orderItem.get('count') }</td>
                        <td>${orderItem.get('location') }</td>
                        <td>${orderItem.get('itemRemark') }</td>
                        <c:if test="${orderCatalog.c_id != 9 }">
                          <td>${orderItem.get('scaleTime') }</td>
                          <td>${orderItem.get('deliverTime') }</td>
                        </c:if>
                      </tr>
                    </c:forEach>
                  </tbody>
                </table>
              </div>
              <div style="padding-left: 15px; padding-right: 15px;">
                <label>补充说明(特殊工艺或造型)</label>
              </div>
              <div style="padding-left: 15px; padding-right: 15px;">
                <textarea class="form-control" readonly="readonly">${orderCatalog.catalogRemark }</textarea>
              </div>
              <div>
                <label></label>
              </div>
              <div class="row" style="padding-left: 15px; padding-top: 10px; padding-bottom: 10px;">
                <div class="col-sm-4">客户确认签字:</div>
                <div class="col-sm-4">主材经理签字:</div>
                <div class="col-sm-4">主材专员签字:</div>
              </div>
            </div>
          </div>
        </c:if>
      </c:forEach>

      <div class="row">
        <fieldset>
          <div id="legend">
            <legend>订单总览</legend>
          </div>
        </fieldset>
      </div>
      <div class="row">
        <div class="panel panel-default">
          <div class="panel-heading">总览</div>
          <div class="panel-body">
            <div>
              <label>备注（增减项说明）</label>
            </div>
            <div>
              <textarea class="form-control" rows="4" readonly="readonly">${order.orderRemark }</textarea>
            </div>
            <div>
              <c:if test="${order.planType == 4}">
                <div class="col-md-4 col-md-offset-8">
                  <h4>订单总价：￥${order.price }
                  <c:if test="${order.discount > 0 }">
                    <!-- 自定义套餐可能有折扣信息 -->
                    &nbsp;<font color="gray" size="-1">(${order.discount }&nbsp;折后)</font>
                  </c:if>
                  </h4>
                </div>
              </c:if>
              <c:if test="${order.planType != 4 }">
                <!-- 标准套餐 -->
                <div class="col-md-4 col-md-offset-8">
                  <h4>订单总价：￥${order.price }</h4>
                </div>
              </c:if>
            </div>
            <div class="row" style="padding-top:15px;">
              <div class="col-sm-4">客户确认签字:</div>
              <div class="col-sm-4">主材经理签字:</div>
              <div class="col-sm-4">主材专员签字:</div>
            </div>
          </div>
        </div>
      </div>

      <div class="row">
        <div class="col-md-4"></div>
        <div class="col-md-4">
          <input type="button" class="btn btn-lg btn-block btn-primary" value="返回"  onclick="history.go(-1);"/>
        </div>
        <div class="col-md-4"></div>
      </div>
    </div>
  <!-- /container -->
</body>

</html>